import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num:10
  },
  mutations: {
    xq(state,xq){
        state.num+=xq;
    }
  },
  actions: {
    myXq({commit}){
        setTimeout(()=>{
          commit('xq',1)
        },3000)
    }
  },
  modules: {
  },
  getters:{
    money(state){
      return "￥"+state.num
    }
  }
})
